package top.zhuyougu.demo1.controler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.zhuyougu.demo1.pojo.Course;
import top.zhuyougu.demo1.pojo.User;
import top.zhuyougu.demo1.service.CourseService;
import top.zhuyougu.demo1.service.UserService;

import java.util.List;

@RestController
@RequestMapping("course")
public class CourseController {
    @Autowired
    private CourseService courseService;

    @GetMapping("findAll")
    public List<Course> findAll(){
        return courseService.findAll();
    }

    @GetMapping("findPage")
    public List<Course> findPage(@RequestParam("page")Integer page,
                               @RequestParam("pageSize")Integer pageSize){
        return courseService.findPage(page,pageSize);
    }
}
